package miscelanea;

import static org.junit.Assert.*;

import org.junit.Test;

public class DataTest {

	@Test
	public void testData() {
		// Correto
		try {
			Data data1 = new Data("03022012");
		} catch (Exception e) {
			assertNull(e);
		}
		
		// Errado
		try {
			Data data2 = new Data("03/02/2012");
		} catch (Exception e) {
			assertNotNull(e);
		}
	}

	@Test
	public void testDiferenca() throws Exception {
		Data data1 = new Data("02041991");
		Data data2 = new Data("25051991");
		
		int diferenca = 53;
		
		assertEquals(diferenca, data1.diferenca(data2));
	}

}
